package com.cqjtu.tto.controller;

import com.cqjtu.tto.service.SalaryService;
import com.cqjtu.tto.vo.Results;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/salary")
@Api(tags = {"员工工资接口"})
public class SalaryController {

    @Autowired
    private SalaryService salaryService;
    @ApiOperation(value="获取员工上次工资情况", notes="员工上次的工资情况，仅管理员拥有此权限，返回类型为SalaryVo")
    @GetMapping("/listEmployeeSalary")
    public Results listEmployeeSalary(){
        return salaryService.listEmployeeSalary();
    }
    @ApiOperation(value="获取员工历史工资", notes="获取员工历史工资，参数为id为员工的id，返回类型为SalaryVo")
    @GetMapping("/listEmployeeHistoryByUserId")
    public Results listEmployeeHistoryByUserId(@RequestParam("id")Long sysUserId){
        return salaryService.listEmployeeHistoryByUserId(sysUserId);
    }
}
